package com.ncs.leisure.overall.ui;

import com.ncs.leisure.overall.ui.vo.MemberBean;

/**
 * 
 * <p>登录系统表单</p>
 * 
 * @author Neo 2008 2008-9-3下午11:31:10
 *
 */

public class LoginForm extends BasicForm{
		
	//登录统一认证系统
	
	public String loginIn(String username,String password){
		
		this.loadSpring();
		
		Object result=contactBusiness.loginServer(username, password);
		
		//返回错误信息
		
		if(result instanceof String){
			
			if(result.equals("error:null")){
				
				return "帐号不存在";
				
			}else if(result.equals("error:more")){
				
				return "多帐号存在";
				
			}else if(result.equals("error:password")){
				
				return "密码不正确";
				
			}else{
				
				return (String)result;
				
			}
		
		//登录成功写入session信息，并且传回成功信息	
			
		}else if(result instanceof MemberBean){
			
			session.setAttribute("baseMember", result);
			
			return "passed";
			
		}else{
			
			System.out.println("逻辑返回未知类型");
			
			return null;
			
		}
		
		
	}
	
	
	
}
